defmodule TuistWeb.Components.EmptyStateBackground do
  @moduledoc """
  SVG component that provides a grid background for empty state UI elements.
  """
  use Phoenix.Component

  def empty_state_background(assigns) do
    unique_id = Ecto.UUID.generate()
    mask_id = "mask0_#{unique_id}"
    radial_gradient_id = "paint0_radial_#{unique_id}"
    linear_gradient_1_id = "paint1_linear_#{unique_id}"
    linear_gradient_2_id = "paint2_linear_#{unique_id}"

    assigns = assign(assigns, :mask_id, mask_id)
    assigns = assign(assigns, :radial_gradient_id, radial_gradient_id)
    assigns = assign(assigns, :linear_gradient_1_id, linear_gradient_1_id)
    assigns = assign(assigns, :linear_gradient_2_id, linear_gradient_2_id)

    ~H"""
    <svg width="700" height="296" viewBox="0 0 700 296" fill="none" xmlns="http://www.w3.org/2000/svg">
      <mask
        id={@mask_id}
        style="mask-type:alpha"
        maskUnits="userSpaceOnUse"
        x="0"
        y="0"
        width="700"
        height="296"
      >
        <path d="M0 0H700V296H0V0Z" fill={"url(##{@radial_gradient_id})"} fill-opacity="0.25" />
      </mask>
      <g mask={"url(##{@mask_id})"}>
        <path
          d="M554.231 0H604.615M554.231 0V50.3846M554.231 0H503.846M604.615 0V50.3846M604.615 0H655V50.3846M604.615 50.3846H554.231M604.615 50.3846H655M604.615 50.3846V100.769M554.231 50.3846V100.769M554.231 50.3846H503.846M655 50.3846V100.769M604.615 100.769H554.231M604.615 100.769V151.154M604.615 100.769H655M554.231 100.769V151.154M554.231 100.769H503.846M604.615 151.154H554.231M604.615 151.154V201.538M604.615 151.154H655M554.231 151.154V201.538M554.231 151.154H503.846M604.615 201.538H554.231M604.615 201.538V251.923M604.615 201.538H655M554.231 201.538V251.923M554.231 201.538H503.846M604.615 251.923H554.231M604.615 251.923V302.308M604.615 251.923H655M554.231 251.923V302.308M554.231 251.923H503.846M604.615 302.308H554.231M604.615 302.308V352.692M604.615 302.308H655M554.231 302.308V352.692M554.231 302.308H503.846M604.615 352.692H554.231M604.615 352.692V403.077M604.615 352.692H655M554.231 352.692V403.077M554.231 352.692H503.846M604.615 403.077H554.231M604.615 403.077V453.462M604.615 403.077H655M554.231 403.077V453.462M554.231 403.077H503.846M604.615 453.462H554.231M604.615 453.462H655V403.077M554.231 453.462H503.846M655 100.769V151.154M655 151.154V201.538M655 201.538V251.923M655 251.923V302.308M655 302.308V352.692M655 352.692V403.077M50.3846 0H0V50.3846M50.3846 0V50.3846M50.3846 0H100.769M50.3846 50.3846H0M50.3846 50.3846H100.769M50.3846 50.3846V100.769M0 50.3846V100.769M100.769 0V50.3846M100.769 0H151.154M100.769 50.3846H151.154M100.769 50.3846V100.769M151.154 0V50.3846M151.154 0H201.538M151.154 50.3846H201.538M151.154 50.3846V100.769M201.538 0V50.3846M201.538 0H251.923M201.538 50.3846H251.923M201.538 50.3846V100.769M251.923 0V50.3846M251.923 0H302.308M251.923 50.3846H302.308M251.923 50.3846V100.769M302.308 0V50.3846M302.308 0H352.692M302.308 50.3846H352.692M302.308 50.3846V100.769M352.692 0V50.3846M352.692 0H403.077M352.692 50.3846H403.077M352.692 50.3846V100.769M403.077 0V50.3846M403.077 0H453.462M403.077 50.3846H453.462M403.077 50.3846V100.769M453.462 0V50.3846M453.462 0H503.846M453.462 50.3846H503.846M453.462 50.3846V100.769M503.846 0V50.3846M503.846 50.3846V100.769M50.3846 100.769H0M50.3846 100.769V151.154M50.3846 100.769H100.769M0 100.769V151.154M50.3846 151.154H0M50.3846 151.154V201.538M50.3846 151.154H100.769M0 151.154V201.538M50.3846 201.538H0M50.3846 201.538V251.923M50.3846 201.538H100.769M0 201.538V251.923M50.3846 251.923H0M50.3846 251.923V302.308M50.3846 251.923H100.769M0 251.923V302.308M50.3846 302.308H0M50.3846 302.308V352.692M50.3846 302.308H100.769M0 302.308V352.692M50.3846 352.692H0M50.3846 352.692V403.077M50.3846 352.692H100.769M0 352.692V403.077M50.3846 403.077H0M50.3846 403.077V453.462M50.3846 403.077H100.769M0 403.077V453.462H50.3846M50.3846 453.462H100.769M100.769 100.769V151.154M100.769 100.769H151.154M100.769 151.154V201.538M100.769 151.154H151.154M100.769 201.538V251.923M100.769 201.538H151.154M100.769 251.923V302.308M100.769 251.923H151.154M100.769 302.308V352.692M100.769 302.308H151.154M100.769 352.692V403.077M100.769 352.692H151.154M100.769 403.077V453.462M100.769 403.077H151.154M100.769 453.462H151.154M151.154 100.769V151.154M151.154 100.769H201.538M151.154 151.154V201.538M151.154 151.154H201.538M151.154 201.538V251.923M151.154 201.538H201.538M151.154 251.923V302.308M151.154 251.923H201.538M151.154 302.308V352.692M151.154 302.308H201.538M151.154 352.692V403.077M151.154 352.692H201.538M151.154 403.077V453.462M151.154 403.077H201.538M151.154 453.462H201.538M201.538 100.769V151.154M201.538 100.769H251.923M201.538 151.154V201.538M201.538 151.154H251.923M201.538 201.538V251.923M201.538 201.538H251.923M201.538 251.923V302.308M201.538 251.923H251.923M201.538 302.308V352.692M201.538 302.308H251.923M201.538 352.692V403.077M201.538 352.692H251.923M201.538 403.077V453.462M201.538 403.077H251.923M201.538 453.462H251.923M251.923 100.769V151.154M251.923 100.769H302.308M251.923 151.154V201.538M251.923 151.154H302.308M251.923 201.538V251.923M251.923 201.538H302.308M251.923 251.923V302.308M251.923 251.923H302.308M251.923 302.308V352.692M251.923 302.308H302.308M251.923 352.692V403.077M251.923 352.692H302.308M251.923 403.077V453.462M251.923 403.077H302.308M251.923 453.462H302.308M302.308 100.769V151.154M302.308 100.769H352.692M302.308 151.154V201.538M302.308 151.154H352.692M302.308 201.538V251.923M302.308 201.538H352.692M302.308 251.923V302.308M302.308 251.923H352.692M302.308 302.308V352.692M302.308 302.308H352.692M302.308 352.692V403.077M302.308 352.692H352.692M302.308 403.077V453.462M302.308 403.077H352.692M302.308 453.462H352.692M352.692 100.769V151.154M352.692 100.769H403.077M352.692 151.154V201.538M352.692 151.154H403.077M352.692 201.538V251.923M352.692 201.538H403.077M352.692 251.923V302.308M352.692 251.923H403.077M352.692 302.308V352.692M352.692 302.308H403.077M352.692 352.692V403.077M352.692 352.692H403.077M352.692 403.077V453.462M352.692 403.077H403.077M352.692 453.462H403.077M403.077 100.769V151.154M403.077 100.769H453.462M403.077 151.154V201.538M403.077 151.154H453.462M403.077 201.538V251.923M403.077 201.538H453.462M403.077 251.923V302.308M403.077 251.923H453.462M403.077 302.308V352.692M403.077 302.308H453.462M403.077 352.692V403.077M403.077 352.692H453.462M403.077 403.077V453.462M403.077 403.077H453.462M403.077 453.462H453.462M453.462 100.769V151.154M453.462 100.769H503.846M453.462 151.154V201.538M453.462 151.154H503.846M453.462 201.538V251.923M453.462 201.538H503.846M453.462 251.923V302.308M453.462 251.923H503.846M453.462 302.308V352.692M453.462 302.308H503.846M453.462 352.692V403.077M453.462 352.692H503.846M453.462 403.077V453.462M453.462 403.077H503.846M453.462 453.462H503.846M503.846 100.769V151.154M503.846 151.154V201.538M503.846 201.538V251.923M503.846 251.923V302.308M503.846 302.308V352.692M503.846 352.692V403.077M503.846 403.077V453.462"
          stroke={"url(##{@linear_gradient_1_id})"}
        />
        <path
          d="M1209.23 0H1259.62M1209.23 0V50.3846M1209.23 0H1158.85M1259.62 0V50.3846M1259.62 0H1310V50.3846M1259.62 50.3846H1209.23M1259.62 50.3846H1310M1259.62 50.3846V100.769M1209.23 50.3846V100.769M1209.23 50.3846H1158.85M1310 50.3846V100.769M1259.62 100.769H1209.23M1259.62 100.769V151.154M1259.62 100.769H1310M1209.23 100.769V151.154M1209.23 100.769H1158.85M1259.62 151.154H1209.23M1259.62 151.154V201.538M1259.62 151.154H1310M1209.23 151.154V201.538M1209.23 151.154H1158.85M1259.62 201.538H1209.23M1259.62 201.538V251.923M1259.62 201.538H1310M1209.23 201.538V251.923M1209.23 201.538H1158.85M1259.62 251.923H1209.23M1259.62 251.923V302.308M1259.62 251.923H1310M1209.23 251.923V302.308M1209.23 251.923H1158.85M1259.62 302.308H1209.23M1259.62 302.308V352.692M1259.62 302.308H1310M1209.23 302.308V352.692M1209.23 302.308H1158.85M1259.62 352.692H1209.23M1259.62 352.692V403.077M1259.62 352.692H1310M1209.23 352.692V403.077M1209.23 352.692H1158.85M1259.62 403.077H1209.23M1259.62 403.077V453.462M1259.62 403.077H1310M1209.23 403.077V453.462M1209.23 403.077H1158.85M1259.62 453.462H1209.23M1259.62 453.462H1310V403.077M1209.23 453.462H1158.85M1310 100.769V151.154M1310 151.154V201.538M1310 201.538V251.923M1310 251.923V302.308M1310 302.308V352.692M1310 352.692V403.077M705.385 0H655V50.3846M705.385 0V50.3846M705.385 0H755.769M705.385 50.3846H655M705.385 50.3846H755.769M705.385 50.3846V100.769M655 50.3846V100.769M755.769 0V50.3846M755.769 0H806.154M755.769 50.3846H806.154M755.769 50.3846V100.769M806.154 0V50.3846M806.154 0H856.538M806.154 50.3846H856.538M806.154 50.3846V100.769M856.538 0V50.3846M856.538 0H906.923M856.538 50.3846H906.923M856.538 50.3846V100.769M906.923 0V50.3846M906.923 0H957.308M906.923 50.3846H957.308M906.923 50.3846V100.769M957.308 0V50.3846M957.308 0H1007.69M957.308 50.3846H1007.69M957.308 50.3846V100.769M1007.69 0V50.3846M1007.69 0H1058.08M1007.69 50.3846H1058.08M1007.69 50.3846V100.769M1058.08 0V50.3846M1058.08 0H1108.46M1058.08 50.3846H1108.46M1058.08 50.3846V100.769M1108.46 0V50.3846M1108.46 0H1158.85M1108.46 50.3846H1158.85M1108.46 50.3846V100.769M1158.85 0V50.3846M1158.85 50.3846V100.769M705.385 100.769H655M705.385 100.769V151.154M705.385 100.769H755.769M655 100.769V151.154M705.385 151.154H655M705.385 151.154V201.538M705.385 151.154H755.769M655 151.154V201.538M705.385 201.538H655M705.385 201.538V251.923M705.385 201.538H755.769M655 201.538V251.923M705.385 251.923H655M705.385 251.923V302.308M705.385 251.923H755.769M655 251.923V302.308M705.385 302.308H655M705.385 302.308V352.692M705.385 302.308H755.769M655 302.308V352.692M705.385 352.692H655M705.385 352.692V403.077M705.385 352.692H755.769M655 352.692V403.077M705.385 403.077H655M705.385 403.077V453.462M705.385 403.077H755.769M655 403.077V453.462H705.385M705.385 453.462H755.769M755.769 100.769V151.154M755.769 100.769H806.154M755.769 151.154V201.538M755.769 151.154H806.154M755.769 201.538V251.923M755.769 201.538H806.154M755.769 251.923V302.308M755.769 251.923H806.154M755.769 302.308V352.692M755.769 302.308H806.154M755.769 352.692V403.077M755.769 352.692H806.154M755.769 403.077V453.462M755.769 403.077H806.154M755.769 453.462H806.154M806.154 100.769V151.154M806.154 100.769H856.538M806.154 151.154V201.538M806.154 151.154H856.538M806.154 201.538V251.923M806.154 201.538H856.538M806.154 251.923V302.308M806.154 251.923H856.538M806.154 302.308V352.692M806.154 302.308H856.538M806.154 352.692V403.077M806.154 352.692H856.538M806.154 403.077V453.462M806.154 403.077H856.538M806.154 453.462H856.538M856.538 100.769V151.154M856.538 100.769H906.923M856.538 151.154V201.538M856.538 151.154H906.923M856.538 201.538V251.923M856.538 201.538H906.923M856.538 251.923V302.308M856.538 251.923H906.923M856.538 302.308V352.692M856.538 302.308H906.923M856.538 352.692V403.077M856.538 352.692H906.923M856.538 403.077V453.462M856.538 403.077H906.923M856.538 453.462H906.923M906.923 100.769V151.154M906.923 100.769H957.308M906.923 151.154V201.538M906.923 151.154H957.308M906.923 201.538V251.923M906.923 201.538H957.308M906.923 251.923V302.308M906.923 251.923H957.308M906.923 302.308V352.692M906.923 302.308H957.308M906.923 352.692V403.077M906.923 352.692H957.308M906.923 403.077V453.462M906.923 403.077H957.308M906.923 453.462H957.308M957.308 100.769V151.154M957.308 100.769H1007.69M957.308 151.154V201.538M957.308 151.154H1007.69M957.308 201.538V251.923M957.308 201.538H1007.69M957.308 251.923V302.308M957.308 251.923H1007.69M957.308 302.308V352.692M957.308 302.308H1007.69M957.308 352.692V403.077M957.308 352.692H1007.69M957.308 403.077V453.462M957.308 403.077H1007.69M957.308 453.462H1007.69M1007.69 100.769V151.154M1007.69 100.769H1058.08M1007.69 151.154V201.538M1007.69 151.154H1058.08M1007.69 201.538V251.923M1007.69 201.538H1058.08M1007.69 251.923V302.308M1007.69 251.923H1058.08M1007.69 302.308V352.692M1007.69 302.308H1058.08M1007.69 352.692V403.077M1007.69 352.692H1058.08M1007.69 403.077V453.462M1007.69 403.077H1058.08M1007.69 453.462H1058.08M1058.08 100.769V151.154M1058.08 100.769H1108.46M1058.08 151.154V201.538M1058.08 151.154H1108.46M1058.08 201.538V251.923M1058.08 201.538H1108.46M1058.08 251.923V302.308M1058.08 251.923H1108.46M1058.08 302.308V352.692M1058.08 302.308H1108.46M1058.08 352.692V403.077M1058.08 352.692H1108.46M1058.08 403.077V453.462M1058.08 403.077H1108.46M1058.08 453.462H1108.46M1108.46 100.769V151.154M1108.46 100.769H1158.85M1108.46 151.154V201.538M1108.46 151.154H1158.85M1108.46 201.538V251.923M1108.46 201.538H1158.85M1108.46 251.923V302.308M1108.46 251.923H1158.85M1108.46 302.308V352.692M1108.46 302.308H1158.85M1108.46 352.692V403.077M1108.46 352.692H1158.85M1108.46 403.077V453.462M1108.46 403.077H1158.85M1108.46 453.462H1158.85M1158.85 100.769V151.154M1158.85 151.154V201.538M1158.85 201.538V251.923M1158.85 251.923V302.308M1158.85 302.308V352.692M1158.85 352.692V403.077M1158.85 403.077V453.462"
          stroke={"url(##{@linear_gradient_2_id})"}
        />
      </g>
      <defs>
        <radialGradient
          id={@radial_gradient_id}
          cx="0"
          cy="0"
          r="1"
          gradientUnits="userSpaceOnUse"
          gradientTransform="translate(350 148) rotate(90) scale(228.082 366.634)"
        >
          <stop stop-color="#313131" />
          <stop offset="1" stop-color="#313131" stop-opacity="0" />
        </radialGradient>
        <linearGradient
          id={@linear_gradient_1_id}
          x1="327.5"
          y1="0"
          x2="327.5"
          y2="453.462"
          gradientUnits="userSpaceOnUse"
        >
          <stop stop-color="#AEAEAE" />
          <stop offset="1" stop-color="#5D5D5D" stop-opacity="0" />
        </linearGradient>
        <linearGradient
          id={@linear_gradient_2_id}
          x1="982.5"
          y1="0"
          x2="982.5"
          y2="453.462"
          gradientUnits="userSpaceOnUse"
        >
          <stop stop-color="#AEAEAE" />
          <stop offset="1" stop-color="#5D5D5D" stop-opacity="0" />
        </linearGradient>
      </defs>
    </svg>
    """
  end
end
